Skip to content

Conversation

@Vladilen
Copy link
Collaborator

Changelog entry

...

Changelog category

  • Not for changelog (changelog entry is not required)

Description for reviewers

...

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

2025-10-27 11:08:31 UTC Pre-commit check linux-x86_64-relwithdebinfo for 4699bf6 has started.
2025-10-27 11:09:03 UTC Artifacts will be uploaded here
2025-10-27 11:11:13 UTC ya make is running...
🔴 2025-10-27 12:52:51 UTC Too many tests failed, NOT going to retry
🔴 2025-10-27 13:13:22 UTC Some tests failed, follow the links below.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39170 32441 0 3891 2808 30

🟢 2025-10-27 13:13:33 UTC Build successful.
🟡 2025-10-27 13:13:50 UTC ydbd size 2.3 GiB changed* by +113.2 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: db27fa0 merge: 4699bf6 diff diff %
ydbd size 2 436 880 096 Bytes 2 436 995 992 Bytes +113.2 KiB +0.005%
ydbd stripped size 518 034 952 Bytes 518 067 784 Bytes +32.1 KiB +0.006%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

🟢 2025-10-30 16:50:00 UTC The validation of the Pull Request description is successful.

@github-actions
Copy link

github-actions bot commented Oct 27, 2025

2025-10-27 11:11:22 UTC Pre-commit check linux-x86_64-release-asan for 4699bf6 has started.
2025-10-27 11:11:37 UTC Artifacts will be uploaded here
2025-10-27 11:13:03 UTC ya make is running...
🟡 2025-10-27 13:44:24 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15629 15096 0 246 270 17

🟢 2025-10-27 13:44:31 UTC Build successful.
🟡 2025-10-27 13:44:53 UTC ydbd size 3.8 GiB changed* by +190.5 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: db27fa0 merge: 4699bf6 diff diff %
ydbd size 4 055 022 024 Bytes 4 055 217 112 Bytes +190.5 KiB +0.005%
ydbd stripped size 1 505 755 840 Bytes 1 505 834 208 Bytes +76.5 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

2025-10-28 10:51:31 UTC Pre-commit check linux-x86_64-release-asan for 1a0cc95 has started.
2025-10-28 10:51:47 UTC Artifacts will be uploaded here
2025-10-28 10:53:10 UTC ya make is running...
2025-10-28 11:36:36 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

2025-10-28 10:52:48 UTC Pre-commit check linux-x86_64-relwithdebinfo for 1a0cc95 has started.
2025-10-28 10:53:07 UTC Artifacts will be uploaded here
2025-10-28 10:54:37 UTC ya make is running...
2025-10-28 11:36:42 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

2025-10-28 11:39:59 UTC Pre-commit check linux-x86_64-relwithdebinfo for 208583e has started.
2025-10-28 11:40:15 UTC Artifacts will be uploaded here
2025-10-28 11:41:40 UTC ya make is running...
2025-10-28 11:49:33 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

2025-10-28 11:52:22 UTC Pre-commit check linux-x86_64-relwithdebinfo for 4d0f5ae has started.
2025-10-28 11:52:26 UTC Artifacts will be uploaded here
2025-10-28 11:53:56 UTC ya make is running...
🔴 2025-10-28 13:38:41 UTC Too many tests failed, NOT going to retry
🔴 2025-10-28 14:10:24 UTC Some tests failed, follow the links below.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39212 32511 0 3884 2792 25

🟢 2025-10-28 14:10:36 UTC Build successful.
🟢 2025-10-28 14:10:52 UTC ydbd size 2.3 GiB changed* by -25.7 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 744e230 merge: 4d0f5ae diff diff %
ydbd size 2 427 340 304 Bytes 2 427 313 944 Bytes -25.7 KiB -0.001%
ydbd stripped size 517 566 664 Bytes 517 550 856 Bytes -15.4 KiB -0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 28, 2025

2025-10-28 11:59:53 UTC Pre-commit check linux-x86_64-release-asan for 4d0f5ae has started.
2025-10-28 12:00:12 UTC Artifacts will be uploaded here
2025-10-28 12:01:41 UTC ya make is running...
🟡 2025-10-28 14:19:32 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15639 15109 0 236 277 17

🟢 2025-10-28 14:19:39 UTC Build successful.
🟢 2025-10-28 14:20:03 UTC ydbd size 3.8 GiB changed* by -50.0 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 744e230 merge: 4d0f5ae diff diff %
ydbd size 4 062 762 152 Bytes 4 062 710 976 Bytes -50.0 KiB -0.001%
ydbd stripped size 1 509 476 248 Bytes 1 509 444 696 Bytes -30.8 KiB -0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

2025-10-29 15:54:22 UTC Pre-commit check linux-x86_64-relwithdebinfo for 6b6c61f has started.
2025-10-29 15:54:38 UTC Artifacts will be uploaded here
2025-10-29 15:56:02 UTC ya make is running...
2025-10-29 17:14:13 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

2025-10-29 15:54:29 UTC Pre-commit check linux-x86_64-release-asan for 6b6c61f has started.
2025-10-29 15:54:47 UTC Artifacts will be uploaded here
2025-10-29 15:56:08 UTC ya make is running...
2025-10-29 17:14:12 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

2025-10-29 17:16:00 UTC Pre-commit check linux-x86_64-relwithdebinfo for edb26cf has started.
2025-10-29 17:16:43 UTC Artifacts will be uploaded here
2025-10-29 17:18:49 UTC ya make is running...
🟡 2025-10-29 18:47:36 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39258 36438 0 4 2791 25

2025-10-29 18:47:48 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-10-29 19:02:36 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
452 (only retried tests) 434 0 3 0 15

2025-10-29 19:02:39 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-10-29 19:14:28 UTC Some tests failed, follow the links below.

Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
433 (only retried tests) 416 0 3 0 14

🟢 2025-10-29 19:14:31 UTC Build successful.
🟡 2025-10-29 19:14:50 UTC ydbd size 2.3 GiB changed* by +507.2 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: aad5b54 merge: edb26cf diff diff %
ydbd size 2 427 904 976 Bytes 2 428 424 400 Bytes +507.2 KiB +0.021%
ydbd stripped size 517 673 192 Bytes 517 778 280 Bytes +102.6 KiB +0.020%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

2025-10-29 17:16:48 UTC Pre-commit check linux-x86_64-release-asan for edb26cf has started.
2025-10-29 17:17:16 UTC Artifacts will be uploaded here
2025-10-29 17:18:46 UTC ya make is running...
🟡 2025-10-29 19:37:39 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15685 14857 0 433 353 42

🟢 2025-10-29 19:37:48 UTC Build successful.
🟡 2025-10-29 19:38:14 UTC ydbd size 3.8 GiB changed* by +851.2 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: aad5b54 merge: edb26cf diff diff %
ydbd size 4 063 841 144 Bytes 4 064 712 776 Bytes +851.2 KiB +0.021%
ydbd stripped size 1 509 873 432 Bytes 1 510 169 368 Bytes +289.0 KiB +0.020%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

2025-10-30 13:59:01 UTC Pre-commit check linux-x86_64-release-asan for 4ce070f has started.
2025-10-30 13:59:18 UTC Artifacts will be uploaded here
2025-10-30 14:00:39 UTC ya make is running...
🟡 2025-10-30 16:10:34 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15695 15321 0 144 201 29

🟢 2025-10-30 16:10:45 UTC Build successful.
🟢 2025-10-30 16:11:08 UTC ydbd size 3.8 GiB changed* by -5.7 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: ad9bdae merge: 4ce070f diff diff %
ydbd size 4 062 437 064 Bytes 4 062 431 248 Bytes -5.7 KiB -0.000%
ydbd stripped size 1 508 013 336 Bytes 1 507 997 080 Bytes -15.9 KiB -0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

2025-10-30 14:00:15 UTC Pre-commit check linux-x86_64-relwithdebinfo for 4ce070f has started.
2025-10-30 14:00:32 UTC Artifacts will be uploaded here
2025-10-30 14:02:03 UTC ya make is running...
🟡 2025-10-30 15:52:27 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39291 36455 0 2 2807 27

2025-10-30 15:52:40 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-10-30 16:13:16 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
748 (only retried tests) 709 0 0 16 23

🟢 2025-10-30 16:13:19 UTC Build successful.
🟢 2025-10-30 16:13:36 UTC ydbd size 2.3 GiB changed* by +13.1 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: ad9bdae merge: 4ce070f diff diff %
ydbd size 2 426 210 256 Bytes 2 426 223 656 Bytes +13.1 KiB +0.001%
ydbd stripped size 515 653 800 Bytes 515 652 456 Bytes -1.3 KiB -0.000%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@Vladilen Vladilen changed the title [WIP] Json subcolumns store change from string to binary JSON subcolumns store change from string to binary Oct 30, 2025
@Vladilen Vladilen marked this pull request as ready for review October 30, 2025 16:49
@Vladilen Vladilen requested a review from a team as a code owner October 30, 2025 16:49
@github-actions
Copy link

github-actions bot commented Oct 30, 2025

2025-10-30 17:15:14 UTC Pre-commit check linux-x86_64-release-asan for 3fe0219 has started.
2025-10-30 17:15:30 UTC Artifacts will be uploaded here
2025-10-30 17:16:55 UTC ya make is running...
🟡 2025-10-30 19:20:06 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15696 15194 0 193 279 30

🟢 2025-10-30 19:20:13 UTC Build successful.
🟢 2025-10-30 19:20:36 UTC ydbd size 3.8 GiB changed* by -77.7 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: de05a4b merge: 3fe0219 diff diff %
ydbd size 4 062 528 976 Bytes 4 062 449 376 Bytes -77.7 KiB -0.002%
ydbd stripped size 1 508 053 144 Bytes 1 508 005 208 Bytes -46.8 KiB -0.003%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

2025-10-30 17:15:31 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3fe0219 has started.
2025-10-30 17:15:47 UTC Artifacts will be uploaded here
2025-10-30 17:17:11 UTC ya make is running...
🟡 2025-10-30 18:44:59 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39291 36471 0 3 2795 22

2025-10-30 18:45:16 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-10-30 19:10:58 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
790 (only retried tests) 772 0 0 0 18

🟢 2025-10-30 19:11:04 UTC Build successful.
🟢 2025-10-30 19:11:20 UTC ydbd size 2.3 GiB changed* by -48.1 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 3d44e54 merge: 3fe0219 diff diff %
ydbd size 2 426 281 936 Bytes 2 426 232 664 Bytes -48.1 KiB -0.002%
ydbd stripped size 515 672 296 Bytes 515 653 992 Bytes -17.9 KiB -0.004%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

const ui32 size = filterBits.Size();
for (ui64 i = 0; i < HashesCount; ++i) {
const ui64 hash = NArrow::NHash::TXX64::CalcSimple(data, i);
const ui64 hash = NArrow::NHash::TXX64::CalcSimple(data.GetStringRobust(), i);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а GetStringRobust прямо даже вложенный json засериализует?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, он что угодно засериализует. Смысл в том, что если там строка, то он построит индекс по строке без кавычек, а если что-то другое, то он преобразует в нормальный json и построит индексы по нему. Должно работать как раньше, так как сюда приходило всё в виде строки

AFL_VERIFY(CurrentIndex <= GlobalChunkedArray->GetRecordsCount())("index", CurrentIndex)("count", GlobalChunkedArray->GetRecordsCount());
}

NJson::TJsonValue TColumnsData::TIterator::GetValue() const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я кстати не уверен что NJson::TJsonValue это самый эффективный способ хранения json, можно будет поисследовать другие либы как они по префу. Это уже отдельно можно провернуть

@dorooleg dorooleg requested a review from Copilot October 30, 2025 22:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a change to JSON data serialization in the columnar storage engine, transitioning from string-based to binary JSON representation. The key changes include converting JSON values to binary format during storage and properly handling JSON types during data extraction and filtering operations.

Key changes:

  • JSON values are now stored as arrow::BinaryType instead of arrow::StringType, using binary JSON serialization for efficient storage
  • Data extractors now return NJson::TJsonValue instead of std::string_view to preserve type information
  • Added conversion logic to properly deserialize binary JSON to string representation when extracting column paths

Reviewed Changes

Copilot reviewed 43 out of 44 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
ydb/tests/olap/chunks/* New test infrastructure for chunked data scenarios with JSON columns
ydb/core/tx/columnshard/engines/storage/indexes/portions/extractor/* Updated extractors to use NJson::TJsonValue for record visitors
ydb/core/tx/columnshard/engines/storage/indexes/*/meta.cpp Updated bloom filter implementations to work with JSON values
ydb/core/formats/arrow/accessor/sub_columns/* Core changes to use binary storage for JSON data and proper deserialization
ydb/core/formats/arrow/program/kernel_logic.cpp Added binary JSON to string conversion for path extraction
ydb/core/kqp/ut/olap/json_ut.cpp Updated test expectations to reflect proper JSON type preservation
ydb/core/pyrightconfig.json Configuration file with hardcoded paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 10:39:57 UTC Pre-commit check linux-x86_64-relwithdebinfo for 87e352b has started.
2025-10-31 10:40:12 UTC Artifacts will be uploaded here
2025-10-31 10:41:38 UTC ya make is running...
🟡 2025-10-31 12:10:07 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39292 36474 0 1 2791 26

2025-10-31 12:10:23 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-10-31 12:21:00 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
47 (only retried tests) 35 0 0 0 12

🟢 2025-10-31 12:21:03 UTC Build successful.
🟢 2025-10-31 12:21:19 UTC ydbd size 2.3 GiB changed* by +11.7 KiB, which is < 100.0 KiB vs main: OK

ydbd size dash main: 0cbb971 merge: 87e352b diff diff %
ydbd size 2 426 561 136 Bytes 2 426 573 152 Bytes +11.7 KiB +0.000%
ydbd stripped size 515 717 512 Bytes 515 712 392 Bytes -5.0 KiB -0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 10:41:23 UTC Pre-commit check linux-x86_64-release-asan for 87e352b has started.
2025-10-31 10:41:40 UTC Artifacts will be uploaded here
2025-10-31 10:43:03 UTC ya make is running...
🟡 2025-10-31 12:41:32 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15697 15250 0 197 222 28

🟢 2025-10-31 12:41:42 UTC Build successful.
🟢 2025-10-31 12:42:04 UTC ydbd size 3.8 GiB changed* by -9.1 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: a04e6ba merge: 87e352b diff diff %
ydbd size 4 063 322 088 Bytes 4 063 312 808 Bytes -9.1 KiB -0.000%
ydbd stripped size 1 508 300 152 Bytes 1 508 280 760 Bytes -18.9 KiB -0.001%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 14:27:24 UTC Pre-commit check linux-x86_64-relwithdebinfo for 0b7ac51 has started.
2025-10-31 14:27:40 UTC Artifacts will be uploaded here
2025-10-31 14:29:06 UTC ya make is running...
🟡 2025-10-31 16:08:41 UTC Some tests failed, follow the links below. Going to retry failed tests...

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
39293 36476 0 1 2791 25

2025-10-31 16:08:56 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-10-31 16:20:02 UTC Tests successful.

Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
50 (only retried tests) 37 0 0 0 13

🟢 2025-10-31 16:20:05 UTC Build successful.
🟢 2025-10-31 16:20:22 UTC ydbd size 2.3 GiB changed* by -3.8 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 4af0266 merge: 0b7ac51 diff diff %
ydbd size 2 427 637 080 Bytes 2 427 633 192 Bytes -3.8 KiB -0.000%
ydbd stripped size 515 904 712 Bytes 515 893 576 Bytes -10.9 KiB -0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Oct 31, 2025

2025-10-31 14:27:32 UTC Pre-commit check linux-x86_64-release-asan for 0b7ac51 has started.
2025-10-31 14:27:48 UTC Artifacts will be uploaded here
2025-10-31 14:29:13 UTC ya make is running...
🟡 2025-10-31 16:45:35 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
15698 15272 0 176 227 23

🟢 2025-10-31 16:45:43 UTC Build successful.
🟢 2025-10-31 16:46:07 UTC ydbd size 3.8 GiB changed* by -25.1 KiB, which is <= 0 Bytes vs main: OK

ydbd size dash main: 4af0266 merge: 0b7ac51 diff diff %
ydbd size 4 065 299 928 Bytes 4 065 274 224 Bytes -25.1 KiB -0.001%
ydbd stripped size 1 509 159 304 Bytes 1 509 132 712 Bytes -26.0 KiB -0.002%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@Vladilen Vladilen requested review from Copilot and dorooleg October 31, 2025 14:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 34 out of 35 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +73 to +84
ui32 prevIndex = 0;
for (ui32 idx = 0; idx < UI32ColIndex->length(); ++idx) {
auto currentIndex = UI32ColIndex->Value(idx);
for (ui32 i = prevIndex; i < currentIndex; ++i) {
visitor(DefaultsArray);
}
visitor(ColValue->Slice(idx, 1));
prevIndex = currentIndex + 1;
}
for (; prevIndex < RecordsCount; ++prevIndex) {
visitor(DefaultsArray);
}
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VisitValues implementation creates array slices (ColValue->Slice(idx, 1)) in a loop which could be inefficient for large datasets. Consider batching or accessing the underlying array data directly to avoid repeated slice operations.

Copilot uses AI. Check for mistakes.
} else if (container.GetType() == NBinaryJson::EContainerType::Array) {
iterators.emplace_back(std::make_unique<TArrayExtractor>(container.GetArrayIterator(), key));
if (FirstLevelOnly || container.GetType() == NBinaryJson::EContainerType::Array) {
res = NBinaryJson::SerializeToBinaryJson(NBinaryJson::SerializeToJson(container), false);
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This performs a round-trip serialization: binary JSON -> JSON string -> binary JSON. This is inefficient. Consider storing the binary JSON container directly without the intermediate JSON string conversion.

Suggested change
res = NBinaryJson::SerializeToBinaryJson(NBinaryJson::SerializeToJson(container), false);
res = container;

Copilot uses AI. Check for mistakes.
auto future = NRpcService::DoLocalRpc<TEvBulkUpsertRequest>(std::move(request), "", "", runtime->GetActorSystem(0));
future.Subscribe([&](const NThreading::TFuture<Ydb::Table::BulkUpsertResponse> f) mutable {
responses.fetch_add(1);
future.Subscribe([&](const NThreading::TFuture<Ydb::Table::BulkUpsertResponse> f) {
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lambda captures local variables by reference (&) but the future is asynchronous. If the function returns before the callback executes, these references will be dangling. The atomic 'responses' variable and other locals may be destroyed before the callback runs. Consider capturing by value or using shared_ptr for the required state.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to +112
std::string_view view = heap.back().GetValuePointer() ?
std::string_view(heap.back().GetValuePointer()->Data(), heap.back().GetValuePointer()->Size()) : "";
std::string_view* viewPtr = heap.back().GetValuePointer() ? &view : nullptr;
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code calls heap.back().GetValuePointer() multiple times (4 times total). Consider storing the result in a variable to improve readability and avoid redundant calls.

Suggested change
std::string_view view = heap.back().GetValuePointer() ?
std::string_view(heap.back().GetValuePointer()->Data(), heap.back().GetValuePointer()->Size()) : "";
std::string_view* viewPtr = heap.back().GetValuePointer() ? &view : nullptr;
auto* valuePtr = heap.back().GetValuePointer();
std::string_view view = valuePtr ? std::string_view(valuePtr->Data(), valuePtr->Size()) : "";
std::string_view* viewPtr = valuePtr ? &view : nullptr;

Copilot uses AI. Check for mistakes.
@dorooleg
Copy link
Collaborator

dorooleg commented Nov 2, 2025

мне ок, но там еще copilot предложил разумные замечания, оставляю на твое усмотрение

@Vladilen Vladilen merged commit 1787dd7 into ydb-platform:main Nov 3, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants